package com.dushuren.project.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dushuren.project.model.dto.ApplyCaptainGetTeamRequest;
import com.dushuren.project.model.dto.ApplyDeleteTeamRequest;
import com.dushuren.project.model.dto.ApplyJoinTeamRequest;
import com.dushuren.project.model.dto.ApplyListQueryTeamRequest;
import com.dushuren.project.model.entity.TeamApply;
import com.dushuren.project.model.vo.TeamApplyVo;

import java.util.List;

/**
* @author qieqie
* @description 针对表【team_apply(队伍申请管理)】的数据库操作Service
* @createDate 2022-10-19 18:40:21
*/
public interface TeamApplyService extends IService<TeamApply> {

  /**
   *  队伍 申请加入队伍
   * @param applyJoinTeamRequest 申请的基本信息
   * @return
   */
  Boolean applyJoinTeam(ApplyJoinTeamRequest applyJoinTeamRequest);

  /**
   * 队伍 删除申请队伍
   * @param applyDeleteTeamRequest
   * @return
   */
  Boolean applyDeleteTeam(ApplyDeleteTeamRequest applyDeleteTeamRequest);

  /**
   * 队伍 删除该队伍申请通过的队伍
   * @param teamId
   * @param userId
   * @return
   */
  Boolean applyDeleteTeam(Long teamId, Long userId);


  /**
   * 查看所有申请加入队伍列表
   * @param listQueryTeamRequest
   * @return
   */
  List<TeamApplyVo> listQueryApplyTeam(ApplyListQueryTeamRequest listQueryTeamRequest);

  /**
   * 队长查看当前申请列表
   * @param captainGetTeamRequest
   * @return
   */
  List<TeamApplyVo> captainGetApplyTeam(ApplyCaptainGetTeamRequest captainGetTeamRequest);


  /***
   * 校验是否反复申请同一个队伍
   * @param teamId
   * @param userId
   * @return
   */
  Boolean checkApplyTeam(Long teamId, Long userId);

  /***
   * 校验是否为队伍队长 ，是true 不是false
   * @param teamId
   * @param userId
   * @return
   */
  Boolean checkCapatinTeam(Long teamId,Long userId);

  /***
   * 校验 userId 申请的数量有多少
   * @param userId
   * @return
   */
  Long applyTeamNum(Long userId);


  /***
   * 校验 id 是否存在
   * @param id
   * @return
   */
  Boolean isApplyTeamId(Long id, Integer status);


}
